package com.piece.module.flowable.model;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;

@Data
@Entity
@NoArgsConstructor
@Table(name = "wf_deploy_form")
@IdClass(WfDeployForm.WfDeployFormPrimaryKey.class)
@ApiModel(value = "流程实例关联表:wf_deploy_form")
public class WfDeployForm implements Serializable {

    @Id
    @Column(name = "deploy_id", length = 64)
    @ApiModelProperty(value = "流程部署主键")
    private String deployId;

    @Id
    @Column(name = "form_key", length = 64)
    @ApiModelProperty(value = "表单Key")
    private String formKey;

    @Id
    @Column(name = "form_name", length = 64)
    @ApiModelProperty(value = "表单Key")
    private String formName;

    @Id
    @Column(name = "node_key", length = 64)
    @ApiModelProperty(value = "节点Key")
    private String nodeKey;

    @Column(name = "node_name")
    @ApiModelProperty(value = "节点名称")
    private String nodeName;

    @Column(name = "form_id")
    @ApiModelProperty(value = "表单主键")
    private Long formId;

    @Column(name = "content")
    @ApiModelProperty(value = "表单内容")
    private String content;

    @Data
    static class WfDeployFormPrimaryKey implements Serializable {
        private String deployId;
        private Long formId;
        private String formKey;
        private String nodeKey;
    }
}
